package com.qax.task.cron;

import java.util.concurrent.ScheduledFuture;

/**
 * Task scheduler interface that abstracts the scheduling of
 * {@link Runnable Runnables} based on different kinds of triggers.
 * Maybe is
 * @see javax.enterprise.concurrent.ManagedScheduledExecutorService
 * <p>You can implement it and implement your own concurrent execution manager<p/>
 *
 *
 * @author leiliang
 */
public interface TaskScheduler {

    ScheduledFuture<?> schedule(Runnable task/*Responsible for specific implementation*/,
                                Trigger trigger/*Responsible for execution time context management*/)
            throws TaskRejectedException;

}
